#include<iostream> 
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<cmath>
#include<string.h>
using namespace std;

double f(int n)
{
     if( n>=90&&n<=100 )         return 4.0;
     else   if( n>=85&&n<=89 )    return 3.7;
     else   if( n>=82&&n<=84 )    return 3.3;
     else   if( n>=78&&n<=81 )    return 3.0;
     else   if( n>=75&&n<=77 )    return 2.7;
     else   if( n>=72&&n<=74 )    return 2.3;
     else   if( n>=68&&n<=71 )    return 2.0;
     else   if( n>=64&&n<=67 )    return 1.5;
     else   if( n>=60&&n<=63 )    return 1.0;
     else   if( n<60 )           return 0.0;
}
int main()
{ 
  int n,a[10],b[10],i,sum;
  double Gpa;
  while(cin>>n){
  sum=0;Gpa=0;
  for( i=0;i<n;i++)
  {  cin>>a[i];
     sum+=a[i];
  }
  for( i=0;i<n;i++)
  {  cin>>b[i];
     Gpa+=a[i]*f( b[i] );
  }
  printf("%.2f\n",Gpa/sum);
  }
  //system("pause");
  return 0;
}
